export default {
    //默认的key值
    key:"02B_data",
    //设置
    setStorage: function (value,flag=false){
        
        if(value == null || value ==""){
            return false;
        }

        flag == false? localStorage.setItem(this.key,value) : localStorage.setItem(this.key,JSON.stringify(value))
    },
    //获取
    getStorage: function(value,flag=false){
        let data = localStorage.getItem(this.key);

        //为空直接为空
        if(data == null){
            return null;
        }

        return flag == false ? data : JSON.parse(data);
    }
}